using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LitTools
{
    public class UIManager : MonoSingleton<UIManager>
    {
        public AssetsCatalog UIAssetCatalog { get; set; }

        public void OpenUI(string uiKey, Transform canvas)
        {
            AssetsManager.Instance.LoadAsset<GameObject>(UIAssetCatalog, uiKey, obj =>
            {
                var ui = Instantiate(obj, canvas);
                var uibase = ui.GetComponent<UIBase>();
                uibase.Init();
            });
        }

        public void CloseUI(GameObject uiGameObject, bool destroy)
        {

        }
    }

    public abstract class UIBase : MonoBehaviour
    {
        public virtual void Init() { }
        public virtual void OnUIShow() { }
        public virtual void OnUIClose(bool destroy) { }
    }
}